home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 19 / CU Amiga Magazine's Super CD-ROM 19 (1998)(EMAP Images)(GB)[!][issue 1998-02].iso / CUCD / Magazine / SoundLab / Studio16add / includes / libraries / Studio16file.h next >
Encoding:
C/C++ Source or Header  |  1997-12-10  |  19.3 KB  |  757 lines

  1. #ifndef LIBRARIES_STUDIO16FILE_H
  2. #define LIBRARIES_STUDIO16FILE_H
  3.  
  4. /*
  5. **
  6. **    The unofficial developer docs for Studio 16 files.
  7. **
  8. **        $VER: Studio16fileformats 3.2 (09.12.97)
  9. **
  10. **    This document is copyright by Kenneth "Kenny" Nilsen.
  11. **    Freely distributable. Commercial authors should read the
  12. **    guide/doc file in the Studio16add.lha archive.
  13. **
  14. **    Cuelist file analyzed by
  15. **
  16. **        Kenneth "Kenny" Nilsen <kenny@bgnett.no> and
  17. **        John Blyth <john.blyth@edserv.monash.edu.au>
  18. **
  19. **    - STUDIO16 SAMPLE      [KWK3] full description of sample files
  20. **    - STUDIO16 CUELIST     [TLC1] full description of cuelist files
  21. **    - STUDIO16 TRACK       [TRAX] full description of track files
  22. **    - STUDIO16 VOL/PAN ENV [SRMX] full description of mixer files
  23. **    - STUDIO16 GRAPHFILE   <noID>  [not included in this release]
  24. */
  25.  
  26. #ifndef EXEC_TYPES_H
  27. #include <exec/types.h>
  28. #endif
  29.  
  30. /* Initializers */
  31.  
  32. #define    ID_KWK    0x4B574B33    /* S16 sample files. */
  33. #define    ID_TLC    0x544C4331    /* S16 cuelist files. */
  34. #define    ID_TYPE    0x54595045    /* S16 cuelist chunks. */
  35. #define    ID_SAMP    0x53414D50
  36. #define    ID_EVNT    0x45564E54
  37. #define    ID_END    0x454E4421    /* End mark in S16 cuelist files. */
  38. #define    ID_TRAX    0x54524158    /* S16 Cuelist track files. */
  39. #define    ID_SRMX    0x53524D58    /* Volume/Pan envelope files. */
  40. #define    ID_VOL    0x564F4C20    /* SRMX chunks. */
  41. #define    ID_PAN    0x50414E20
  42. #define    ID_CHAN    0x4348414E
  43.  
  44.  
  45. #define    S16FILTERINIT    1L    /* use may also use S16S_RATE (S16R_RATE/2). */
  46. #define    S16FLAGINIT    0L    /* init S16S_FLAGS with this value. */
  47.  
  48.  
  49. /*  Structure of a SMPTE stamp: */
  50.  
  51. struct    S16SMPTESTAMP
  52. {
  53.     UBYTE    S16SMPTE_HOURS;     /* number of hours */
  54.     UBYTE    S16SMPTE_MIN;     /* number of minuttes. */
  55.     UBYTE    S16SMPTE_SEC;     /* number of seconds. */
  56.     UBYTE    S16SMPTE_FRAMES; /* number of frames rel. to PAL/NTSC etc. */
  57. }
  58.  
  59. /* File header structure
  60.  
  61.    Studio 16 SAMPLEFILE contains:
  62.  
  63.     [STUDIO16SAMPLE]    SampleClips and Regions inclusive (below)
  64.     [SAMPLEDATA]
  65.  
  66.   Originally:
  67.  
  68.     [HEADERID]
  69.     [SAMPLEINFO STRUCT]
  70.     [SAMPLECLIPS x128]
  71.     [REGIONS x32]
  72.     [SAMPLEDATA]
  73.  
  74.   Sampledata consists of pure signed RAW 16-bit data in Motorola format */
  75.  
  76. struct    S16SAMPLE    /* Studio 16 SAMPLE files. 
  77. {
  78.  
  79.     ULONG    S16S_ID;    /* FILE HEADER ID (Init with ID_KWK). */
  80.  
  81. /*  SampleInfo struct: */
  82.  
  83.     ULONG    S16S_RATE;    /* sample rate in integer. */
  84.     ULONG    S16S_FILTER;    /* Init with S16FILTERINIT or (S16F_RATE). */
  85.     UWORD    S16S_VOLUME;    /* Calculated volume. */
  86.     struct    S16SMPTESTAMP *S16S_SMPTE;    /* SMPTE timecode. */
  87.     FLOAT    S16S_SMPTEFLOAT;    /* SMPTE sampling rate as float. */
  88.     ULONG    S16S_PAN;    /* Calculated pan. */
  89.     ULONG    S16S_FLAGS;    /* (undocumented), init with S16FLAGSINIT. */
  90.     ULONG    S16S_res;    /* Reserved field. */
  91.  
  92. /*  Related to the sample data: */
  93.  
  94.     ULONG    S16S_REALSIZE;    /* number of samples (bytesize/2). */
  95.     ULONG    S16S_EDITSIZE;    /* number of samples after editlist. */
  96.  
  97. /*  here follows a list of SampleClips (see format of sampleclips below) */
  98.  
  99.     ULONG    S16S_EDITLIST;    /* here starts the SampleClip list. */
  100.     ULONG    S16S_END;    /* init this with REALSIZE-1 if newfile. */
  101.  
  102.     UBYTE    S16S_SAMPLECLIPLIST[1016]; /* list excl. the one above (=1024) */
  103.  
  104. /*  Here starts the Region list */
  105.  
  106.     UBYTE    S16S_REGIONLIST[2624];    /* region list (S16R_SIZEOF x32). */
  107. }
  108.  
  109.  
  110. /*  Edit size is calculated by calculating the sum of all SampleClips:
  111.  
  112.     S16SC_END-S16SC_START+1
  113.  
  114.  How to determine SampleClip-list end:
  115.  
  116.      Add all SampleClips togetter until (S16S_END or S16SC_END) = 0 AND
  117.      the size you have got equals S16R_EDITSIZE. The reason is that some
  118.      SampleClip may result in a NULL size since it's included due to non
  119.      size edits such as volume changes.
  120.  
  121.   The SampleClip structure is contained in the STUDIO16FILE structure. It is
  122.   repeated 128 times: */
  123.  
  124. struct    S16SAMPLECLIP
  125. {
  126.     ULONG    S16SC_START;        /* start pos in range. */
  127.     ULONG    S16SC_END;        /* end pos in range. */
  128. }
  129.  
  130. #define    MAXSAMPLECLIPS    128        /* max number of clips in file. */
  131.  
  132. /*  Regions are ranges which keep their own settings so you can make a region */
  133. /*  act like a seperate file: */
  134.  
  135. #define    S16REGIONINIT    0        /* or use S16F_RATE as FLOAT. */
  136. #define    S16REGIONSIZE    82
  137.  
  138. struct    S16REGION
  139. {
  140.     UBYTE    S16R_NAME[40];        /* name on region. */
  141.  
  142. /* sampleclip: */
  143.  
  144.     ULONG    S16R_START;        /* sample start pos. */
  145.     ULONG    S16R_END;        /* sample end pos - size=end-start+1. */
  146.  
  147. /* sampleinfo: */
  148.  
  149.     ULONG    S16R_RATE;        /* sample rate. */
  150.     ULONG    S16R_FILTER;        /* Init with $1 (K16FINIT). */
  151.     UWORD    S16R_VOLUME;        /* sample volume. */
  152.     struct    S16SMPTESTAMP *S16R_SMPTE;    /* SMPTE timecode. */
  153.     FLOAT    S16R_SMPTEFLOAT;        /* init with S16REGIONINIT. */
  154.     ULONG    S16R_PAN;        /* pan. */
  155.     ULONG    S16R_FLAGS;        /* misc flags (undocumented). */
  156.     UBYTE    S16R_res[8];        /* reserved space. */
  157. }
  158.  
  159. #define    MAXREGIONS    32        /* max number of regions in list. */
  160. #define    MAXREGIONNAME    24        /* max number of chars in name - use this */
  161.                     /* to be compatible with Studio 16 editor. */
  162.  
  163. /*  Sample rates for Studio 16: */
  164.  
  165. #define    S16_FREQ_0    0x1589    /*  5513 hz                 */
  166. #define    S16_FREQ_1    0x19D7    /*  6615 hz                */
  167. #define    S16_FREQ_2    0x1F40    /*  8000 hz RA (RealAudio)        */
  168. #define    S16_FREQ_3    0x2580    /*  9600 hz TELE            */
  169. #define    S16_FREQ_4    0x2B11    /* 11025 hz                */
  170. #define    S16_FREQ_5    0x3e80    /* 16000 hz                */
  171. #define    S16_FREQ_6    0x49D4    /* 18900 hz                */
  172. #define    S16_FREQ_7    0x5622    /* 22050 hz                */
  173. #define    S16_FREQ_8    0x6B25    /* 27429 hz                */
  174. #define    S16_FREQ_9    0x7D00    /* 32000 hz FM, REELS            */
  175. #define    S16_FREQ_A    0x8133    /* 33075 hz HIBAND ->Betacam/MII/Umatic    */
  176. #define    S16_FREQ_B    0x93A8    /* 37800 hz                */
  177. #define    S16_FREQ_C    0xAC44    /* 44100 hz CD                */
  178. #define    S16_FREQ_D    0xBB80    /* 48000 hz DAT                */
  179.  
  180. /*  For convinience only: */
  181.  
  182. #define    S16_FREQ_RA    S16_FREQ_2
  183. #define    S16_FREQ_TELE    S16_FREQ_3
  184. #define    S16_FREQ_FM    S16_FREQ_9
  185. #define    S16_FREQ_REEL    S16_FREQ_9
  186. #define    S16_FREQ_HIBAND    S16_FREQ_A
  187. #define    S16_FREQ_CD    S16_FREQ_C
  188. #define    S16_FREQ_DAT    S16_FREQ_D
  189.  
  190. /*  Volumes
  191.  
  192.  Calc: S16F_VOLUME/S16_VOL_STEPS-100 = x dB
  193.        value = (x dB + 100) x S16_VOL_STEPS */
  194.  
  195. #define    S16_VOL_0    0x0C80    /*  +0 dB */
  196. #define    S16_VOL_OFF    0x0000    /*  oo dB */
  197.  
  198. #define    S16_VOL_STEPS    0x0020    /* you may use 1/4th of this step. */
  199.  
  200. /*  for convinience only: */
  201.  
  202. #define    S16_VOL_DOUBLE    0x0D40    /*  +6.0 dB (200 % volume). */
  203. #define    S16_VOL_NORMAL    0x0C80    /*  +0.0 dB (100 % volume). */
  204. #define    S16_VOL_HALF    0x0BC0    /*  -6.0 dB ( 50 % volume). */
  205. #define    S16_VOL_QUATER    0x0B00    /* -12.0 dB ( 25 % volume). */
  206. #define    S16_VOL_BACK    0x09C0    /* -22.0 dB (music for voiceover). */
  207.  
  208. /* Pans
  209.  
  210.   Calc: S16F_PAN/S16_PAN_STEPS = Pan pos 0-200, 100=center
  211.         value = Pan x S16_PAN_STEPS */
  212.  
  213. #define    S16_PAN_LEFT    0x0000    /* full left. */
  214. #define    S16_PAN_MID    0x0C80    /* center. */
  215. #define    S16_PAN_RIGHT    0x1900    /* full right. */
  216.  
  217. #define    S16_PAN_STEPS    0x0020    /* you may use 1/4th of this step. */
  218.  
  219. /*  for convinience only: */
  220.  
  221. #define    S16_PAN_LEFT50    0x0640    /* 50% to left. */
  222. #define    S16_PAN_RIGHT50    0x12C0    /* 50% to right. */
  223.  
  224. /*---------------------------------------------------------------------------
  225. ** From 3.0
  226. **---------------------------------------------------------------------------*/
  227.  
  228. /* NOTE: The strings used below (except _COMMENT) are of the following format:
  229. *
  230. *    ULONG  STRINGLENGTH
  231. *    STRUCT STRING,STRINGLENGTH
  232. *
  233. * In the stucture overview you will find a container marked [-SOMETHING] which
  234. * means this is a string of the above format. */
  235.  
  236. /* NOTE: All DOUBLE sizes are in seconds. The mantissa is one second's
  237. * resolution, however the resolution can never be greater than the
  238. * frequency (max 1/48000th of a second) in real life. */
  239.  
  240. /* Cuelist fileformat 'TLC1' -
  241.  
  242.  A Cuelist file is built like this:
  243.  
  244.  [TLC1HEADER]
  245.  [TYPE]
  246.  [SAMP/EVNT * n]
  247.  [END mark]
  248.  [TYPE]
  249.  [SAMP/EVNT * n]
  250.  [END mark]
  251.  [TYPE]
  252.  [...and so on...]
  253.  [END mark]
  254.  [END mark]    the double END! mark is end of file
  255. */
  256.  
  257.  
  258. /* TLC1 HEADER consists of:
  259.  
  260.     [TLCHEAD]
  261.     [-PATH x2]
  262.     [-NAME x2]
  263.     [TLCBODY]
  264. */
  265.  
  266. struct    TLCHEAD
  267. {
  268.     ULONG    TLCH_ID;    /* file ID [=TLC1]. */
  269.     ULONG    TLCH_WINLEFT;    /* window position/sizes when saved. Will */
  270.     ULONG    TLCH_WINTOP;    /* become the zip size when loaded. */
  271.     ULONG    TLCH_WINHEIGHT;    /* minimum 90. */
  272.     ULONG    TLCH_WINWIDTH;    /* minimum 377. */
  273. }
  274.  
  275. #define    TLCMINWINWIDTH        377L
  276. #define    TLCMINWINHEIGHT        90L
  277.  
  278. /* then there follows four strings in this format:
  279.  
  280.   [(ULONG)Length of string] [String]
  281.  
  282.  - The first string is 'Track' path
  283.  - The second string is 'Cuelist' path
  284.  - The third string is 'Trackname'
  285.  - The fourth string is 'Cuelistfilename'
  286. */
  287.  
  288. struct    TLCBODY
  289. {
  290.  
  291. /*  preferences */
  292.  
  293.     ULONG    TLCB_LastGroupID;    /* indicates the last group used */
  294.     UWORD    TLCB_res0;
  295.     UBYTE    TLCB_FADEINTYPE;    /* See SAMPBODY for different types. */
  296.     UBYTE    TLCB_FADEOUTTYPE;
  297.     DOUBLE    TLCB_MAXTIME;        /* use f.ex. ieeedoubbas.library. */
  298.     DOUBLE    TLCB_GRIDSPACING;
  299.     DOUBLE    TLCB_STARTTIME;        /* start of cuelist */
  300.     ULONG    TLCB_TOTALLENGTH;    /* in seconds*100 */
  301.     ULONG    TLCB_VIEWSIZE;        /* when saved (sec*100) */
  302.     ULONG    TLCB_VIEWSTART;        /* (sec*100) */
  303.     ULONG    TLCB_BPM;        /* Beats Per Minutes. */
  304.     ULONG    TLCB_BPMX;        /* BPM X/Y (f.ex 4/4). */
  305.     ULONG    TLCB_BPMY;
  306.     ULONG    TLCB_TIMEOPTIONS;    /* what timer is used (SMPTE/CLK/BPM). */
  307.     UBYTE    TLCB_res1[122];
  308.  
  309. /*  flag markers */
  310.  
  311.     DOUBLE    TLCB_F1POS;        /* position of mark (-1=not used). */
  312.     LONG    TLCB_F1VIEWPOS;        /* If -1 then the flag is not in view.
  313.                        else, start of view in sec*100
  314.                        you may ignore this value. */
  315.     UBYTE    TLCB_F1COMMENT[80];    /* Comment including NULL termination. */
  316.     UBYTE    TLCB_f1reserved[30];    /* Reserved for ASCII representation, but
  317.                      isn't implemented in current Studio16 */
  318.  
  319.     DOUBLE    TLCB_F2POS;
  320.     LONG    TLCB_F2VIEWPOS;
  321.     UBYTE    TLCB_F2COMMENT[80];
  322.     UBYTE    TLCB_f2reserved[30];
  323.  
  324.     DOUBLE    TLCB_F3POS;
  325.     LONG    TLCB_F3VIEWPOS;
  326.     UBYTE    TLCB_F3COMMENT[80];
  327.     UBYTE    TLCB_f3reserved[30];
  328.  
  329.     DOUBLE    TLCB_F4POS;
  330.     LONG    TLCB_F4VIEWPOS;
  331.     UBYTE    TLCB_F4COMMENT[80];
  332.     UBYTE    TLCB_f4reserved[30];
  333.  
  334.     DOUBLE    TLCB_F5POS;
  335.     LONG    TLCB_F5VIEWPOS;
  336.     UBYTE    TLCB_F5COMMENT[80];
  337.     UBYTE    TLCB_f5reserved[30];
  338.  
  339.     DOUBLE    TLCB_F6POS;
  340.     LONG    TLCB_F6VIEWPOS;
  341.     UBYTE    TLCB_F6COMMENT[80];
  342.     UBYTE    TLCB_f6reserved[30];
  343.  
  344.     DOUBLE    TLCB_F7POS;
  345.     LONG    TLCB_F7VIEWPOS;
  346.     UBYTE    TLCB_F7COMMENT[80];
  347.     UBYTE    TLCB_f7reserved[30];
  348.  
  349.     DOUBLE    TLCB_F8POS;
  350.     LONG    TLCB_F8VIEWPOS;
  351.     UBYTE    TLCB_F8COMMENT[80];
  352.     UBYTE    TLCB_f8reserved[30];
  353.  
  354.     DOUBLE    TLCB_F9POS;
  355.     LONG    TLCB_F9VIEWPOS;
  356.     UBYTE    TLCB_F9COMMENT[80];
  357.     UBYTE    TLCB_f9reserved[30];
  358.  
  359.     DOUBLE    TLCB_F10POS;
  360.     LONG    TLCB_F10VIEWPOS;
  361.     UBYTE    TLCB_F10COMMENT[80];
  362.     UBYTE    TLCB_f10reserved[30];
  363.  
  364.     DOUBLE    TLCB_LOCATEPOS;        /* red location mark. */
  365.     LONG    TLCB_LOCATEVIEWPOS;
  366.     UBYTE    TLCB_LOCATECOMMENT[80];
  367.     UBYTE    TLCB_LOCATEASCII[30];    /* ASCII representation of location mark.
  368.                     Only mark which has support for this.
  369.                     Note that the ascii also reflects
  370.                     which time mode is used (SMPTE/BPM..). */
  371.  
  372.     DOUBLE    TLCB_STARTPOS;        /* blue start mark. */
  373.     LONG    TLCB_STARTVIEWPOS;
  374.     UBYTE    TLCB_STARTCOMMENT[80];
  375.     UBYTE    TLCB_startreserved[30];    /* reserved. */
  376.  
  377.     DOUBLE    TLCB_PUNCHINPOS;    /* yellow punch-in mark. */
  378.     LONG    TLCB_PUNCHINVIEWPOS;
  379.     UBYTE    TLCB_PUNCHINCOMMENT[80];
  380.     UBYTE    TLCB_punchinreserved[30];
  381.  
  382.     DOUBLE    TLCB_PUNCHOUTPOS;    /* yellow punch-out mark. */
  383.     LONG    TLCB_PUNCHOUTVIEWPOS;
  384.     UBYTE    TLCB_PUNCHOUTCOMMENT[80];
  385.     UBYTE    TLCB_punchoutreserved[30];
  386.  
  387.     UBYTE    TLCB_res2[100];        /* reserved. */
  388.  
  389. }
  390.  
  391. /*  Timer options: */
  392.  
  393. #define    TLCTIME_HOURMINUTESECOND    0x00
  394. #define    TLCTIME_SMPTE            0x01
  395. #define    TLCTIME_BPM            0x02
  396. #define    TLCTIME_SMPTEPLUS        0x04
  397.  
  398. #define    TLCMARK_NOTINUSE        -1    /* Mark isn't used. */
  399. #define    TLCMARK_OUTSIDE            -1    /* Mark is not in view. */
  400.  
  401. /*  Bit defs */
  402.  
  403. #define    TLCTIMEB_SMPTE            0
  404. #define    TLCTIMEB_BPM            1
  405. #define    TLCTIMEB_SMPTEPLUS        2
  406.  
  407.  
  408. /*  The 'TYPE' chunk can be two types: "Audio" or "AREXX". The Type describes
  409. *  each track in the cuelist.
  410. *  You first need to check which type of track this is and then
  411. *  use the structure for the tracktype.
  412. *  To determine the track type you must first read the first
  413. *  string:
  414. *   [(ULONG)Length of string] [String]
  415. *  This can be either "Audio" or "AREXX".
  416. *  You must then read the next string in the same format to get the track name.
  417. *  This applies to both types.
  418. *  If the type="AREXX" then you must read an additional string to get the port
  419. *  name.
  420. */
  421.  
  422. /*  TYPE CHUNK consists of:
  423. *  Common:
  424. *     [-TYPE OF TRACK STRING]
  425. *     [-NAME OF TRACK]
  426. *  Audio:
  427. *     [TYPEAUDIO]
  428. *     [-PLAY CHANNEL]
  429. *     [-REC CHANNEL]
  430. *     [TYPEAUDIOFOOT]
  431. *  AREXX:
  432. *     [-NAME OF PORT]
  433. *     [TYPEAREXX]
  434. */
  435.  
  436. /*  "Audio" TRACK - */
  437.  
  438. struct    TYPEAUDIO
  439. {
  440.     DOUBLE    TYPA_RATE;    /* this track's frequency. */
  441.     UBYTE    TYPA_USELPREFS;    /* prefs when entries are unselected. */
  442.     UBYTE    TYPA_SELPREFS;    /* prefs when entries are selected. */
  443.     UBYTE    TYPA_TRACKPREFS;    /* prefs for track status. */
  444.     UBYTE    TYPA_ENTRIES;    /* if track contains (un)selected entries. */
  445. }
  446.  
  447. /*  For type there are two more strings right after this structure you must read.
  448. *  The first string is name on the play channel, the second is the name of the
  449. *  record channel. Note that some types of channel (like 'Any') gets prefixed by
  450. *  what card is used (f.ex. "AD516.Any").
  451. *  After the two strings there is reserved 100 bytes which you must skip to get
  452. *  the next chunk.
  453. */
  454.  
  455. struct    TYPEAUDIOFOOT
  456. {
  457.     UBYTE    TYPAF_res[100];
  458. }
  459.  
  460.  
  461. /*  "AREXX" TRACK - */
  462.  
  463. struct    TYPEAREXX
  464. {
  465.     UWORD    TYPR_res0;
  466.     UBYTE    TYPR_TRACKPREFS;
  467.     UBYTE    TYPR_pad0;
  468.     UBYTE    TYPR_res1[100];
  469. }
  470.  
  471.  
  472. /*  flags for track preferences: */
  473.  
  474. #define    TYPAPREF_SHOWREGIONNAME        0x01
  475. #define    TYPAPREF_SHOWSTARTTIME        0x02
  476. #define    TYPAPREF_SHOWSAMPLESIZE        0x04
  477. #define    TYPAPREF_SHOWFADETIME        0x08
  478.  
  479. /*  for both track types (Audio/AREXX): */
  480.  
  481. #define    TYPTRACK_SOUNDBUTTONON        0x01
  482. #define    TYPTRACK_SOLOBUTTONON        0x02
  483. #define    TYPTRACK_TRACKSELECTED        0x04
  484.  
  485. /*  entries' status in track (global for one track): */
  486.  
  487. #define    TYPTRACK_ENTRIESUNSELECTED    0x00
  488. #define    TYPTRACK_ENTRIESSELECTED    0x02
  489.  
  490. /*  bit defs: */
  491.  
  492. #define    TYPAPREFB_SHOWREGIONNAME    0    /* OR togetter to set more */
  493. #define    TYPAPREFB_SHOWSTARTTIME        1    /* options at the same time. */
  494. #define    TYPAPREFB_SHOWSAMPLESIZE    2
  495. #define    TYPAPREFB_SHOWFADETIME        3
  496.  
  497. #define    TYPTRACKB_SOUNDBUTTONON        0
  498. #define    TYPTRACKB_SOLOBUTTONON        1
  499. #define    TYPTRACKB_TRACKSELECTED        2
  500.  
  501. #define    TYPTRACKB_ENTRIESSELECTED    1
  502.  
  503.  
  504. /*  The 'SAMP' chunk contains data of each entries on an 'Audio' type of track.
  505. *  You can find volume, pan, position, sizes, fades and so on.
  506. */
  507.  
  508. /*  SAMP -
  509. *  SAMP CHUNK consist of:
  510. *     [SAMPHEAD]
  511. *     [-SAMPLE PATH/NAME]
  512. *     [SAMPBODY]
  513. */
  514.  
  515. struct    SAMPHEAD
  516. {
  517.     ULONG    SAMPH_STATUS;    /* status of entry. */
  518.     DOUBLE    SAMPH_STARTPOS;    /* startposition of entry in sec. */
  519.     DOUBLE    SAMPH_ENDPOS;
  520.     ULONG    SAMPH_res0;
  521.     ULONG    SAMPH_GROUPID;    /* Group this entry belongs to (null=none). */
  522. }
  523.  
  524. /* Right after this structure you will find a string of the type:
  525. *   [(ULONG)Length of string] [String]
  526. *  which contains path and sample name. Then the chunk continues with
  527. *  this structure:
  528. */
  529.  
  530. struct    SAMPBODY
  531. {
  532.     WORD    SAMPB_res0;
  533.     UBYTE    SAMPB_FADEINTYPE;    /* what fadetype is used for intro. */
  534.     UBYTE    SAMPB_FADEOUTTYPE;
  535.     DOUBLE    SAMPB_FADEINTIME;    /* fade time 0=none. */
  536.     DOUBLE    SAMPB_FADEOUTTIME;
  537.     ULONG    SAMPB_CROPIN;            /* Sample start (rel. to pos) in */
  538.     ULONG    SAMPB_CROPOUT;        /* number of samples */
  539.     UWORD    SAMPB_VOLUME;        /* see S16S_VOL_... */
  540.     ULONG    SAMPB_PAN;        /* see S16S_PAN_... */
  541.     UBYTE    SAMPB_res1[50];        /* 50 bytes reserved. */
  542. }
  543.  
  544. /*  flags for sample entry status: */
  545.  
  546. #define    SAMPSTAT_NOEXIST    0x00
  547. #define    SAMPSTAT_NOEXISTSEL    0x01
  548. #define    SAMPSTAT_OK        0x02
  549. #define    SAMPSTAT_OKSEL        0x03
  550.  
  551. /*  flags for fade types: */
  552.  
  553. #define    FADE_LINEAR        0x00    /* linear fade. */
  554. #define    FADE_BUTT        0x01    /* no fade. */
  555. #define    FADE_LOGA        0x02    /* logaritmic fade. */
  556. #define    FADE_EXPO        0x04    /* exponential fade. */
  557.  
  558. /*  bit defs */
  559.  
  560. #define    SAMPSTATB_SELECTED    0    /* sample is selected. */
  561. #define    SAMPSTATB_OK        1    /* sample exists. */
  562.  
  563. #define    FADEB_BUTT        0
  564. #define    FADEB_LOGA        1
  565. #define    FADEB_EXPO        2
  566.  
  567. /*  The 'EVNT' chunk is for "AREXX" type of tracks. It contains
  568. *  mostly strings for the comands you specify.
  569. */
  570.  
  571. /*  EVNT -
  572. *  ENVT CHUNK consists of
  573. *     [EVENTHEAD]
  574. *     [-ENTRYNAME]
  575. *     [EVENTBODY]
  576. *     [-COMANDS x9]
  577. *     [EVENTFOOT]
  578. */
  579.  
  580. struct    EVENTHEAD
  581. {
  582.     ULONG    EVENTH_STATUS;        /* status of entry. */
  583.     DOUBLE    EVENTH_STARTPOS;    /* startpos of script. */
  584.     DOUBLE    EVENTH_ENDPOS;
  585.     ULONG    EVENTH_res0;
  586.     ULONG    EVENTH_GROUPID;        /* group this script belongs to. */
  587.     ULONG    EVENTH_res1;
  588. }
  589.  
  590. /*  Following this structure you will find a string of the type:
  591. *   [(ULONG)Length of string] [String]
  592. *  which contains the name of the entry. After the string you will
  593. *  find a SMPTE stamp:
  594. */
  595.  
  596. struct    EVENTBODY
  597. {
  598.     struct    S16SMPTESTAMP *EVENTB_SMPTE;    /* see S16SMPTESTAMP */
  599. }
  600.  
  601. /*  Following this structure you will find 9 string of the type:
  602. *   [(ULONG)Length of string] [String]
  603. *  which contains comand definitions from 1-9. Note that the stringsize may be
  604. *  NULL. After those strings you will have to skip 50 bytes reserved space to
  605. *  get to the next chunk.
  606. */
  607.  
  608. struct    EVENTFOOT
  609. {
  610.     UBYTE    EVENTF_res[50];
  611. }
  612.  
  613.  
  614. #define    EVENTSTAT_UNSELECTED    0
  615. #define    EVENTSTAT_SELECTED    1
  616.  
  617. /*  bit defs */
  618.  
  619. #define    TSTATB_SELECTED        0
  620.  
  621. /* ------------------------------------------------------------------------------
  622. * TRACK 'TRAX' files is similar to 'TLC1' except they don't have a TLC1 header,
  623. * they only have one TYPE chunk followed by either 'SAMP' or 'EVNT' dependent
  624. * on TYPE type. Then SAMP or EVNT chunks follows ended with a END!.
  625. *
  626. * TRAX FILE consists of:
  627. *
  628. * [TRAXID]
  629. * [TYPE]
  630. * [SAMP or EVNT]
  631. * [END!]
  632. */
  633.  
  634. /* ------------------------------------------------------------------------------
  635. * VOLUME AND PAN ENVELOPE FILES (MIXER FILES)
  636. */
  637.  
  638. /*  Volume/Pan env file is a standard IFF file. It consists of the following
  639. *  chunks:
  640. *   [FORM=SRMX]
  641. *   ['VOL ']
  642. *   ['PAN ']
  643. *   ['CHAN']
  644. *  There are ten channels in a file (atleast on a singlecard system), eight are
  645. *  play channels, while one is input channel and one is output channel.
  646. */
  647.  
  648. /*  'VOL ' CHUNK consists of
  649. *   [ Time         ]
  650. *   [ (Vol+100)*32 ]
  651. *  These are repeated x number of times. Only changes are recorded.
  652. *  The size will always be dividable with eight.
  653. */
  654.  
  655. struct    SRMXVOL
  656. {
  657.     ULONG    SVOL_POSITION;
  658.     ULONG    SVOL_VOLUME;
  659. }
  660.  
  661. /*  'PAN ' CHUNK consists of
  662. *   [ Time   ]
  663. *   [ Pan*32 ]
  664. *  These are repeated x number of times. Only changes are recorded.
  665. *  The size will always be dividable with eight.
  666. */
  667.  
  668. struct    SRMXPAN
  669. {
  670.     ULONG    SPAN_POSITION;
  671.     ULONG    SPAN_PAN;
  672. }
  673.  
  674. /*  'CHAN' CHUNK consists of
  675. *  [CHANID]
  676. *  [unknown]
  677. *  [PREFS]
  678. *  [RESERVED]
  679. */
  680.  
  681. struct    SRMXCHAN
  682. {
  683.     UWORD    SCHAN_CARDID;    /* Card ID, count from 0-3 */
  684.     UWORD    SCHAN_CHANID;    /* channel ID. */
  685.     ULONG    SCHAN_STATUS;    /* (unknown=always seem to be -1). */
  686.     UBYTE    SCHAN_VOLMIDICH; /* MIDI channel for volumes. */
  687.     UBYTE    SCHAN_VOLCTRLID; /* volume (MIDI) controller  ID (def.=7). */
  688.     UBYTE    SCHAN_PANMIDCH;    /* midi channel for pan. */
  689.     UBYTE    SCHAN_PANCTRLID; /* pan (MIDI) controller ID  (def.=10). */
  690.     UWORD    SCHAN_GROUPTYPE; /* fader connections. */
  691.     UWORD    SCHAN_res1;
  692. }
  693.  
  694. #define    SRMX_TIME    0x0100    /* 256 steps per second, position 10s = $A00 */
  695.                 /* second 0 to 1 uses (0-255). */
  696.  
  697. #define    SCHANSTATUS_INIT -1L    /* init _STATUS with this value */
  698.  
  699. /*  channel IDs */
  700.  
  701. #define    CHANID_INPUT        0x0000 /* IDs used in _CHANID */
  702. #define    CHANID_CHAN1        0x0001
  703. #define    CHANID_CHAN2        0x0002
  704. #define    CHANID_CHAN3        0x0003
  705. #define    CHANID_CHAN4        0x0004
  706. #define    CHANID_CHAN5        0x0005
  707. #define    CHANID_CHAN6        0x0006
  708. #define    CHANID_CHAN7        0x0007
  709. #define    CHANID_CHAN8        0x0008
  710. #define    CHANID_OUTPUT        0x000D
  711.  
  712. /*  group methode */
  713.  
  714. #define    CHANGROUP_OFF        0x00
  715. #define    CHANGROUP_ALONG        0x01
  716. #define    CHANGROUP_AGAINST    0x02
  717.  
  718. /*  bit defs */
  719.  
  720. #define    CHANGROUPB_ALONG    0
  721. #define    CHANGROUPB_AGAINST    1
  722.  
  723. /* ------------------------------------------------------------------------------
  724. * GRAPH FILES for Studio 16 samples
  725. */
  726.  
  727. /*  SORRY ! - the graph file analysis didn't make it for this release! */
  728.  
  729. #endif /* LIBRARIES_STUDIO16FILE_H */
  730.